//
//  GYZCountryTableViewCell.m
//  Qyer
//
//  Created by GYz on 15/10/20.
//  Copyright © 2015年 GF. All rights reserved.
//

#import "GYZCountryTableViewCell.h"
#import "BaseHeader.h"

@implementation GYZCountryTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        UICollectionViewFlowLayout *flow = [[UICollectionViewFlowLayout alloc]init];
        flow.itemSize = CGSizeMake(SCREEN_WIDTH/7*3.1, SCREEN_WIDTH/25 * 6.6);
        flow.sectionInset = UIEdgeInsetsMake(SCREEN_WIDTH/35, SCREEN_WIDTH/25, SCREEN_WIDTH/35, SCREEN_WIDTH/25);
        
        [flow setMinimumInteritemSpacing:10];
        [flow setMinimumLineSpacing:10];
        
        self.collectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 10, SCREEN_WIDTH, 2*SCREEN_WIDTH/25 * 6.6+0.12*SCREEN_WIDTH) collectionViewLayout:flow];
        self.collectionView.backgroundColor = [UIColor whiteColor];
        [self.collectionView registerClass:[GYZCountryCollectionViewCell class] forCellWithReuseIdentifier:@"countryCollectionViewCell"];
        [self.contentView addSubview:self.collectionView];
    }
    return self;
}

- (void)setDelegate:(id<UICollectionViewDelegate>)delegate
{
    [self.collectionView setDelegate:delegate];
}
- (void)setDataSource:(id<UICollectionViewDataSource>)dataSource
{
    [self.collectionView setDataSource:dataSource];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
